<template>
  <div>
    <svg :style="{ width, height }">
      <use :fill="color" :xlink:href="prefix + name"></use>
    </svg>
  </div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
  name: 'SvgIcon'
})
</script>
<script lang="ts" setup>
withDefaults(
  defineProps<{
    prefix?: string
    color?: string
    width: number
    height: number
    name: string
  }>(),
  {
    prefix: '#icon-',
    width: 16,
    height: 16,
    color: '#333'
  }
)
</script>

<style lang="scss" scoped></style>
